class CreateStatuses < ActiveRecord::Migration
  def self.up
    create_table :statuses do |t|
      t.column :name, :string
    end

    puts "Creating some default status"
    [{:id => 1, :name => "Open"},
     {:id => 2, :name => "Fixed"},
     {:id => 3, :name => "Duplicate"},
     {:id => 4, :name => "Invalid"},
     {:id => 5, :name => "WorksForMe"},
     {:id => 6, :name => "WontFix"}].each do |status|
      Status.create(status) unless Status.find_by_name(status[:name])
    end
  end

  def self.down
    drop_table :statuses
  end


end


